// default parameters

var link = function (height = 50,color = 'red') {
    console.log(height+color)

}
link()

//template literals

let first = 'first';
let last = 'last';
var name = `Your name is ${first} ${last}`;
console.log(name);

//multi line string

var roadPoem =
`Then took the other, as just as fair,
And having perhaps the better claim
Because it was grassy and wanted wear,
Though as for that the passing there
Had worn them really about the same,`;

console.log(roadPoem);

//arrow functions

var ids = ['5632953c4e345e145fdf2df8','563295464e345e145fdf2df9'];
var msg = ids.map((value, index, list) => `ID of ${index} element is ${value} `);
console.log(msg);

//Promises

setTimeout(function(){
    console.log('Yay!');
}, 1000);

var wait1000 =  new Promise(function(resolve, reject) {setTimeout(resolve, 1000);}).then(function() {console.log('Yay!');});

var wait2000 =  ()=> new Promise((resolve, reject)=> {setTimeout(resolve, 2000)});
    wait2000()
    .then(function() {
        console.log('Yay!')
        return wait2000()
    })
    .then(function() {
        console.log('Wheeyee!')
    });

//class
class baseModel{
    constructor(options,data){
        this.name = 'base';
        this.url = 'whapp.cn';
        this.data = data;
        this.options = options
    }
    getName(){
        console.log(`Class name: ${this.name}`)
    }
}
